<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    
    <title>Masked arrays &mdash; NumPy v1.18 Manual</title>
    
    <link rel="stylesheet" type="text/css" href="../_static/css/spc-bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../_static/css/spc-extend.css">
    <link rel="stylesheet" href="../_static/scipy.css" type="text/css" >
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" >
    <link rel="stylesheet" href="../_static/graphviz.css" type="text/css" >
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.18.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <script type="text/javascript" src="../_static/js/copybutton.js"></script>
    <link rel="author" title="About these documents" href="../about.html" >
    <link rel="index" title="Index" href="../genindex.html" >
    <link rel="search" title="Search" href="../search.html" >
    <link rel="top" title="NumPy v1.18 Manual" href="../index.html" >
    <link rel="up" title="Array objects" href="arrays.html" >
    <link rel="next" title="The numpy.ma module" href="maskedarray.generic.html" >
    <link rel="prev" title="numpy.broadcast.reset" href="generated/numpy.broadcast.reset.html" > 
  </head>
  <body>
<div class="container">
  <div class="top-scipy-org-logo-header" style="background-color: #a2bae8;">
    <a href="../index.html">
      <img border=0 alt="NumPy" src="../_static/numpy_logo.png"></a>
    </div>
  </div>
</div>


    <div class="container">
      <div class="main">
        
	<div class="row-fluid">
	  <div class="span12">
	    <div class="spc-navbar">
              
    <ul class="nav nav-pills pull-left">
        <li class="active"><a href="https://numpy.org/">NumPy.org</a></li>
        <li class="active"><a href="https://numpy.org/doc">Docs</a></li>
        
        <li class="active"><a href="../index.html">NumPy v1.18 Manual</a></li>
        

          <li class="active"><a href="index.html" >NumPy Reference</a></li>
          <li class="active"><a href="arrays.html" accesskey="U">Array objects</a></li> 
    </ul>
              
              
    <ul class="nav nav-pills pull-right">
      <li class="active">
        <a href="../genindex.html" title="General Index"
           accesskey="I">index</a>
      </li>
      <li class="active">
        <a href="maskedarray.generic.html" title="The numpy.ma module"
           accesskey="N">next</a>
      </li>
      <li class="active">
        <a href="generated/numpy.broadcast.reset.html" title="numpy.broadcast.reset"
           accesskey="P">previous</a>
      </li>
    </ul>
              
	    </div>
	  </div>
	</div>
        

	<div class="row-fluid">
      <div class="spc-rightsidebar span3">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="generated/numpy.broadcast.reset.html"
                        title="previous chapter">numpy.broadcast.reset</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="maskedarray.generic.html"
                        title="next chapter">The <code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy.ma</span></code> module</a></p>
<div id="searchbox" style="display: none" role="search">
  <h4>Quick search</h4>
    <div>
    <form class="search" action="../search.html" method="get">
      <input type="text" style="width: inherit;" name="q" />
      <input type="submit" value="search" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
          <div class="span9">
            
        <div class="bodywrapper">
          <div class="body" id="spc-section-body">
            
  <div class="section" id="masked-arrays">
<span id="maskedarray"></span><h1>Masked arrays<a class="headerlink" href="#masked-arrays" title="Permalink to this headline">¶</a></h1>
<p>Masked arrays are arrays that may have missing or invalid entries.
The <a class="reference internal" href="maskedarray.generic.html#module-numpy.ma" title="numpy.ma"><code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy.ma</span></code></a> module provides a nearly work-alike replacement for numpy
that supports data arrays with masks.</p>
<div class="toctree-wrapper compound" id="index-0">
<ul>
<li class="toctree-l1"><a class="reference internal" href="maskedarray.generic.html">The <code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy.ma</span></code> module</a><ul>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#rationale">Rationale</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#what-is-a-masked-array">What is a masked array?</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#id1">The <code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy.ma</span></code> module</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="maskedarray.generic.html#using-numpy-ma">Using numpy.ma</a><ul>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#constructing-masked-arrays">Constructing masked arrays</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#accessing-the-data">Accessing the data</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#accessing-the-mask">Accessing the mask</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#accessing-only-the-valid-entries">Accessing only the valid entries</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#modifying-the-mask">Modifying the mask</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#indexing-and-slicing">Indexing and slicing</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#operations-on-masked-arrays">Operations on masked arrays</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="maskedarray.generic.html#examples">Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#data-with-a-given-value-representing-missing-data">Data with a given value representing missing data</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#filling-in-the-missing-data">Filling in the missing data</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#numerical-operations">Numerical operations</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.generic.html#ignoring-extreme-values">Ignoring extreme values</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="maskedarray.baseclass.html">Constants of the <code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy.ma</span></code> module</a></li>
<li class="toctree-l1"><a class="reference internal" href="maskedarray.baseclass.html#the-maskedarray-class">The <code class="xref py py-class docutils literal notranslate"><span class="pre">MaskedArray</span></code> class</a><ul>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.baseclass.html#attributes-and-properties-of-masked-arrays">Attributes and properties of masked arrays</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="maskedarray.baseclass.html#maskedarray-methods"><code class="xref py py-class docutils literal notranslate"><span class="pre">MaskedArray</span></code> methods</a><ul>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.baseclass.html#conversion">Conversion</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.baseclass.html#shape-manipulation">Shape manipulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.baseclass.html#item-selection-and-manipulation">Item selection and manipulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.baseclass.html#pickling-and-copy">Pickling and copy</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.baseclass.html#calculations">Calculations</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.baseclass.html#arithmetic-and-comparison-operations">Arithmetic and comparison operations</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.baseclass.html#representation">Representation</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.baseclass.html#special-methods">Special methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="maskedarray.baseclass.html#specific-methods">Specific methods</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="routines.ma.html">Masked array operations</a><ul>
<li class="toctree-l2"><a class="reference internal" href="routines.ma.html#constants">Constants</a></li>
<li class="toctree-l2"><a class="reference internal" href="routines.ma.html#creation">Creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="routines.ma.html#inspecting-the-array">Inspecting the array</a></li>
<li class="toctree-l2"><a class="reference internal" href="routines.ma.html#manipulating-a-maskedarray">Manipulating a MaskedArray</a></li>
<li class="toctree-l2"><a class="reference internal" href="routines.ma.html#operations-on-masks">Operations on masks</a></li>
<li class="toctree-l2"><a class="reference internal" href="routines.ma.html#conversion-operations">Conversion operations</a></li>
<li class="toctree-l2"><a class="reference internal" href="routines.ma.html#masked-arrays-arithmetics">Masked arrays arithmetics</a></li>
</ul>
</li>
</ul>
</div>
</div>


          </div>
        </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container container-navbar-bottom">
      <div class="spc-navbar">
        
      </div>
    </div>
    <div class="container">
    <div class="footer">
    <div class="row-fluid">
    <ul class="inline pull-left">
      <li>
        &copy; Copyright 2008-2019, The SciPy community.
      </li>
      <li>
      Last updated on Feb 20, 2020.
      </li>
      <li>
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.4.2.
      </li>
    </ul>
    </div>
    </div>
    </div>
  </body>
</html>